# v没有重复元素，无序
s = {1, 2, 3, 4}
print(s)
s1 = set([1, 2, 4, 5])
s2 = set((2, 4, 6, 8))
s3 = set('hello')
print(s1, s2, s3)
s4 = set({1: 'a', 2: 'b'})  # 使用字典转为set，只存储key
print(s4)
print('-' * 10)
# 遍历
for i in s:
    print(i)

# 方法
s.remove(1)
print(s)
s.add(9)
print(s)
print('-'*10)

# 交集和并集
print(s & s1)
print(s | s1)